<?php defined('_JEXEC') or die('Restricted access');

$currentFolder = '';
if (isset($this->state->folder) && $this->state->folder != '') {
	$currentFolder = $this->state->folder;
}
// SEF problem
$isThereQM = false;
$isThereQM = preg_match("/\?/i", $this->tmpl['action']);
if ($isThereQM) {
	$amp = '&amp;';
} else {
	$amp = '?';
}
?>

<div class="separatore"></div>
<div id="phocagallery-upload">
	<form onsubmit="return OnUploadSubmit();" action="<?php echo $this->tmpl['action'] . $amp ?>task=upload&amp;<?php echo $this->session->getName().'='.$this->session->getId(); ?>&amp;<?php echo JUtility::getToken();?>=1&amp;viewback=category" id="uploadForm" method="post" enctype="multipart/form-data">
		<fieldset>
			<legend><?php echo JText::_( 'vuoi aggiungere una foto?' ); ?></legend>
	
			<div id="show-message"></div>
	
			<p>
				<label for="file-upload">file</label>
				<input type="file" id="file-upload" name="Filedata" />
			</p>
			
			<div class="pulizia"></div>
			
			<?php
			if ($this->tmpl['displaytitleupload'] == 1 || $this->tmpl['displaydescupload'] == 1) {
				if ($this->tmpl['displaytitleupload'] == 1) {
					?>
					<p>
						<label for="file-upload">titolo</label>
						<input type="text" id="phocagallery-upload-title" name="phocagalleryuploadtitle" value="" />
					</p>

					<?php
				}
				/*
				if ($this->tmpl['displaydescupload'] == 1) {
					?>
					<tr>
						<td><?php echo JText::_( 'Description' ); ?>:</td>
						<td><textarea id="phocagallery-upload-description" name="phocagalleryuploaddescription" onkeyup="countCharsUpload();" cols="30" rows="10" class="comment-input"></textarea></td>
					</tr>
					
					<tr>
						<td>&nbsp;</td>
						<td><?php echo JText::_('Characters written');?> <input name="phocagalleryuploadcountin" value="0" readonly="readonly" class="comment-input2" /> <?php echo JText::_('and left for description');?> <input name="phocagalleryuploadcountleft" value="<?php echo $this->tmpl['maxuploadchar'];?>" readonly="readonly" class="comment-input2" />
						</td>
					</tr>
					<?php
				}*/
			}
			?>
			
			<div class="pulizia"></div>
			
			<p>
				<button type="submit" id="file-upload-submit"><?php echo JText::_('carica'); ?></button>
				<span id="upload-clear"></span>
			</p>
			
			<div class="pulizia"></div>
			<div id="loading-label"><center><?php echo JHTML::_('image', 'components/com_phocagallery/assets/images/icon-switch.gif', '') . JText::_('Loading'); ?></center></div>

			<div class="pulizia"></div>
			<p class="note">attenzione: la dimensione del file non deve superare i <?php echo ($this->tmpl['uploadmaxsize'] / 1000000); ?> megabytes</p>
			
			
		<ul class="upload-queue" id="upload-queue">
			<li style="display: none" ></li>
		</ul>

		<input type="hidden" name="tab" value="<?php echo $this->tmpl['currenttab']['upload'];?>" />
		</fieldset>

	</form>
	
</div>
